package javase2.day03.demo02;

import java.util.ArrayList;
import java.util.Collections;

/*
java.utils.Collections是集合工具类，用来对集合进行操作。部分方法如
    public static <T> boolean addAll(Collection<T> c, T... elements)  :往集合中添加一些元素。
    public static void shuffle(List<?> list) 打乱顺序:打乱集合顺序。
 */
public class Demo06Collections {
    public static void main(String[] args) {
        ArrayList<String> arrayList=new ArrayList<>();
        Collections.addAll(arrayList,"ljh","lbh","we","are","family");
        System.out.println(arrayList);//[ljh, lbh, we, are, family]
        Collections.shuffle(arrayList);
        System.out.println(arrayList);//[we, are, ljh, family, lbh]
    }
}
